package com.spring.study.utils;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultUtil<T> {
    private String code;
    private String msg;
    private T data;

    public static <T> ResultUtil<T> success(T data) {
        return new ResultUtil<T>("200", "success", data);
    }

    public static <T> ResultUtil<T> error(String code, String msg) {
        return new ResultUtil<T>(code, msg, null);
    }
    public static <T>ResultUtil<T> success() {
        return new <T>ResultUtil<T>("200", "success", null);
    }
}
